package com.sms.model;

import com.sms.pojo.Student;
import com.sms.pojo.Teacher;
import com.sms.pojo.User;
import lombok.Data;

@Data
public class UserVO {
    private String userId;
    private String userName;
    private String name;

    public UserVO getUser(User user) {
        this.userId = user.getUserId();
        this.userName = user.getUserName();
        this.name = user.getUserName();
        return this;
    }

    public UserVO getTeacherUser(User user, Teacher teacher) {
        this.userId = teacher.getTeacherId();
        this.name = teacher.getTeachName();
        this.userName = user.getUserName();
        return this;
    }

    public UserVO getStudentUser(User user, Student student) {
        this.userId = student.getStudentId();
        this.name = student.getStudentName();
        this.userName = user.getUserName();
        return this;
    }
}
